import moduleRegist from '@/utils/moduleRegist';
import {
  module as instanceModule
} from './module';
const ListView = resolve => {
  require(['./ListView'], resolve);
};

const Layout = resolve => {
  require(['./Layout'], resolve);
};

export default [
  /** 配置管理路由 */
  {
    path: 'token',
    redirect: 'token/list',
    component: Layout,
    meta: {
      title: 'token',
      name: 'token',
      permission: 'auth:menu:token:list',
      componentName: 'TokenLayout',
      keepAlive: true,
      icon: 'md-lock',
      show: false
    },
    beforeEnter: (to, from, next) => {
      moduleRegist(instanceModule);
      next();
    },
    children: [{
      path: 'list',
      component: ListView,
      meta: {
        title: 'token列表',
        name: 'token',
        breadcrumb: 'token列表',
        permission: 'auth:token:query',
        keepAlive: true,
        componentName: 'TokenListView',
        icon: 'md-lock'
      }
    }]
  }
];
